/*
 * @Author: wuqingchun
 * @Date: 2024-10-09 16:13:38
 * @Description: 
 * @LastEditors: wuqingchun
 * @LastEditTime: 2024-10-10 13:38:59
 */

#ifndef __NETPERF_SOCKET_H__
#define __NETPERF_SOCKET_H__

#include "netperf.h"

class CNetperfSocket
{
public:
    CNetperfSocket(const sockaddr_in& refAddr);
    ~CNetperfSocket();

    int32_t CreateTcpServer();
    int32_t CreateUdpServer();
    int32_t CreateTcpClient();
    int32_t CreateUdpClient();
    ssize_t Send(const void* pData, size_t ulDataLen);

    ssize_t Recv();
private:
    int32_t m_iSockFd = -1;
    sockaddr_in m_stAddr;
};

#endif //__NETPERF_SOCKET_H__

